﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="web2012_11_21._Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>无标题页</title>
    <%--<script language="javascript" type="text/javascript">
        //    function x()
        //    {
        //       if(!isNaN(123))
        //       {
        //          alert("123");
        //       }
        //    }
        //             function DisableKey()
        //              {
        //                     //8   退格键
        //                     //78  Ctrl+N
        //                     //37  Alt+ 方向键 ← 
        //                     //39  Alt+ 方向键 →
        //                     //116       F5 刷新键
        //                     //82  Ctrl + R
        //                     //121       shift+F10
        //                     //115       屏蔽Alt+F4
        //                     //屏蔽 shift 加鼠标左键新开一网页
        //                     if (window.event.keyCode==8
        //                            ||event.keyCode==78
        //                            ||event.keyCode==37
        //                            ||event.keyCode==39
        //                            ||event.keyCode==116
        //                            ||event.keyCode==82
        //                            ||event.keyCode==121
        //                            ||event.keyCode==115
        //                            ||(window.event.srcElement.tagName == "A" && window.event.shiftKey))
        //                            {
        //                                   alert("请通过事物代码进行操作");
        //                                   window.event.returnValue=false;
        //                            }
        //
        //              }


        //屏蔽鼠标右键、Ctrl+N、Shift+F10、F11、F5刷新、退格键   
        function document.oncontextmenu() { event.returnValue = false; } //屏蔽鼠标右键   
        function window.onhelp() { return false } //屏蔽F1帮助   
        function document.onkeydown() {
            if ((window.event.altKey) &&
      ((window.event.keyCode == 37) ||   //屏蔽 Alt+ 方向键 ←   
       (window.event.keyCode == 39)))   //屏蔽 Alt+ 方向键 →   
            {
                event.returnValue = false;
            }
            /* 注：这还不是真正地屏蔽 Alt+ 方向键，  
            因为 Alt+ 方向键弹出警告框时，按住 Alt 键不放，  
            用鼠标点掉警告框，这种屏蔽方法就失效了。以后若  
            有哪位高手有真正屏蔽 Alt 键的方法，请告知。*/
            if ((event.keyCode == 116) ||                 //屏蔽 F5 刷新键   
      (event.ctrlKey && event.keyCode == 82)) { //Ctrl + R   
                event.keyCode = 0;
                event.returnValue = false;
            }

            if (event.keyCode == 122) { event.keyCode = 0; event.returnValue = false; }  //屏蔽F11   
            if (event.ctrlKey && event.keyCode == 78) event.returnValue = false;   //屏蔽 Ctrl+n   
            if (event.shiftKey && event.keyCode == 121) event.returnValue = false;  //屏蔽 shift+F10   
            if (window.event.srcElement.tagName == "A" && window.event.shiftKey)
                window.event.returnValue = false;             //屏蔽 shift 加鼠标左键新开一网页   
            if ((window.event.altKey) && (window.event.keyCode == 115))             //屏蔽Alt+F4   
            {
                return false;
            }

            // Backspace按键的控制。  
            var ev = window.event;
            var obj = ev.target || ev.srcElement;
            var t = obj.type || obj.getAttribute('type');

            var vReadOnly = obj.getAttribute('readonly');
            var vEnabled = obj.getAttribute('enabled');

            vReadOnly = (vReadOnly == null) ? false : vReadOnly;
            vEnabled = (vEnabled == null) ? true : vEnabled;

            //当敲Backspace键时，事件源类型为密码或单行、多行文本的，     
            //并且readonly属性为true或enabled属性为false的，则退格键失效     
            var flag1 = (ev.keyCode == 8 && (t == "password" || t == "text" || t == "textarea")
                && (vReadOnly == true || vEnabled != true)) ? true : false;

            //当敲Backspace键时，事件源类型非密码或单行、多行文本的，则退格键失效     
            var flag2 = (ev.keyCode == 8 && t != "password" && t != "text" && t != "textarea")
                ? true : false;

            if (flag2) {
                return false;
            }
            if (flag1) {
                return false;
            }


        }  

    </script>--%>

    <script language="javascript" type="text/javascript">
        var checkSubmitFlg = true;
        function lef() {
        window.opener=null;
        window.close();
        //window.open("HTMLPage1.htm", "name1");//,"height=100,width=400,top=0,left=0,toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,status=no");
//            if (checkSubmitFlg == true) {
//                checkSubmitFlg = false;
//            }
//            else
//                checkSubmitFlg = true;
        }
//        function LeftConfirm() {
//            //alert("123");
//            if (checkSubmitFlg == true) {
//                alert("123");
//                //checkSubmitFlg = false;

//            }
//            else {
//                window.event.returnValue = "确认你要刷新页面吗？";
//                //checkSubmitFlg = true;
//            }
//        }
        //window.open("HTMLPage1.htm", "name1", "height=100,width=400,top=0,left=0,toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,status=no");
        
        function x()
        {
           var a=document.getElementById("TextBox1").value;
           var sea=/(^[0-9]{1,2}$)|(^[0-9]\.[0-9]{1-2}$)|(^[0-9]{1,2}\.[0-9]{1-2})/;///(^[0-9]{3,4}\-[0-9]{7,8}$)|(^[0-9]{7,8}$)|(^\([0-9]{3,4}\)[0-9]{3,8}$)|(^0{0,1}13[0-9]{9}$)|(^0{0,1}15[0-9]{9}$)|(^0{0,1}18[0-9]{9}$)|(^0{0,1}14[0-9]{9}$)/;//
           if(sea.test(a)==true)
           {
             alert("true");
           }
           else
           {
              alert("false");
           }
        }
    </script>

    <style type="text/css">
        .style1
        {
            width: 398px;
        }
    </style>
</head>
<body>
    <%--onbeforeunload="LeftConfirm()"--%>
    <form id="form1" runat="server">
    <div>
        <table runat="server">
            <%--<asp:LinkButton runat="server">LinkButton</asp:LinkButton><asp:LinkButton runat="server">LinkButton</asp:LinkButton>--%>
            <tr>
                <td id="id11" class="style1">
                    <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" />
                    <input id="Button2" type="button" value="button" onclick="lef()" />
                    <br />
                    <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
                    <br />
                    <input type="button" id="Button3"  value="Button" onclick="lef()" />
                    <asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True" 
                        onselectedindexchanged="DropDownList1_SelectedIndexChanged" 
                        ontextchanged="DropDownList1_TextChanged" Width="149px">
                        <asp:ListItem>123</asp:ListItem>
                        <asp:ListItem>234</asp:ListItem>
                    </asp:DropDownList>
                </td>
            </tr>
        </table>
    </div>
    </form>
</body>
</html>
